package my.util;

import java.util.List;

import my.bean.Dbcolumn;

public class XmlCodeUtil {

	public static String xmlString (String table, List<Dbcolumn> colList) {
		StringBuffer sb = new StringBuffer();
		sb.append("\"<?xml version=\" + '\"' + \"1.0\" + '\"' + \" encoding=\" + '\"' + \"GB2312\" + '\"' + \"?>\n");
		sb.append("<FormInfo name=\" + '\"' + \""+table.toUpperCase()+"\" + '\"' + \">\n");
		for(Dbcolumn dbcolumn : colList){
			sb.append("  <Item name=\" + '\"' + \""+dbcolumn.getColName()+"\" + '\"' + \" name_cn=\" + '\"' + \""+dbcolumn.getComments()+"\" + '\"' + \"> \"+E5+\" </Item>\n");
		}
		sb.append("</FormInfo>\n\"");
		return sb.toString();
	}
}
